FROM golang:alpine AS builder
#映射环境
ENV GOPROXY=https://goproxy.cn,direct

RUN mkdir /app
#相当于linux跑的cd
WORKDIR /app

COPY ./ ./
RUN go mod download

RUN go build main.go

FROM scratch

COPY --from=builder ./main ./main
COPY --from=builder ./config.yaml ./config.yaml

CMD ["./main"]